home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1994 November / macformat-018.iso / Demos / Extend 3.0 Demo / Extend Demo / Extend Demo.rsrc / HELP_263_ ModL Operators < prev    next >
Encoding:
Text File  |  1994-07-14  |  1.5 KB  |  52 lines

  1. The standard binary math operators are:
  2. +        addition
  3. -        subtraction
  4. *        multiplication
  5. /        division
  6. ^        exponentiation
  7. %        modulo
  8. MOD        modulo
  9.  
  10. The % and MOD operators return the remainder after integer division. For example, 5 MOD 2 returns 1 and -5 MOD 2 returns -1. Any operation involving a noValue (BLANK) produces a noValue result. NoValue results appear as blank entries in tabular data and are not reflected in plotted traces at all.
  11.  
  12. The Boolean and magnitude operators are:
  13. AND or &&    combination
  14. OR or ||    conjunction
  15. NOT or !    inverse
  16. != or <>    not equal
  17. <        less than
  18. <=        less than or equal to
  19. >        greater than
  20. >=        greater than or equal to
  21. ==        equal to
  22.  
  23. The assignment operators are:
  24. id = expression;   // the assignment statement
  25. id += expression;  // equivalent to id = id + expression;
  26. id -= expression;  //  equivalent to id = id - expression;
  27. id *= expression;  // equivalent to = id * expression;
  28. id /= expression;  //  equivalent to id = id / expression;
  29. id++;   //  equivalent to id = id + 1;
  30. ++id;   //  equivalent to id = id + 1;
  31. id--;   //  equivalent to id = id - 1;
  32. --id;   //  equivalent to id = id - 1;
  33.  
  34. Evaluation order
  35. Operators in an expression are generally evaluated from left to right, however there is a hierarchy of precedence among the operators. The following list is in descending order of precedence. Within each group, operators have equal precedence. Note that putting any expression in parentheses insures that it will always be evaluated first.
  36. ( )
  37. - (negation)
  38. NOT or !
  39. ^
  40. MOD or %
  41. *
  42. /
  43. +
  44. -
  45. <
  46. >
  47. <=
  48. >=
  49. = =
  50. <> or !=
  51. OR or ||
  52. AND or &&